from django.urls import path

from artmarket.views.admin_order_management import AdminOrderListView, AdminOrderApprovalView
from artmarket.views.artwork_view import ArtworkListView, ArtworkDetailView, ArtworkAndArtistView
from artmarket.views.commentandrating_view import CommentAndRatingListView, CommentAndRatingDetailView, \
    CommentAndRatingDeleteView
from artmarket.views.order_view import OrderListView, OrderDetailView
from artmarket.views.purchaseartwork_view import PurchaseArtworkView

urlpatterns = [
    path('artworks/', ArtworkListView.as_view(), name='artwork-list'),
    path('artworks/<int:pk>/', ArtworkDetailView.as_view(), name='artwork-detail'),
    path('artist/artworks/<int:artist_id>/', ArtworkAndArtistView.as_view(), name='artist-artworks-list'),
    path('order/', OrderListView.as_view(), name='order-list'),
    path('admin/order/', AdminOrderListView.as_view(), name='admin-order-list'),
    path('admin/order/<int:pk>/action/<str:action>/', AdminOrderApprovalView.as_view(), name='admin-order-action'),
    path('order/<int:pk>/', OrderDetailView.as_view(), name='order-detail'),
    path('order/purchase/', PurchaseArtworkView.as_view(), name='purchase-artwork'),
    path('comment/rating/', CommentAndRatingListView.as_view(), name='comment-and-rating-list'),
    path('comment/rating/<int:artwork_id>/', CommentAndRatingDetailView.as_view(), name='comment-and-rating-detail'),
    path('commentrating/del/<int:comment_id>/<int:rating_id>/', CommentAndRatingDeleteView.as_view(), name='comment-and-rating-delete'),
]
